<template>
  <div class="SearchBarContainer" @click="toSearch">
    <i class="searchIcon"></i>
    <span class="keyword">搜索商品,共9999款好物</span>
  </div>
</template>
<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
  name: 'SearchBar'
})
</script>
<script lang="ts" setup>
import { useRouter } from 'vue-router'
const router = useRouter()
// 跳转到搜索页
const toSearch = () => {
  router.push('/search')
}
</script>

<style lang="less" scoped>
.SearchBarContainer {
  height: 28px;
  background-color: #ededed;
  box-sizing: border-box;
  border-radius: 6px;
  font-size: 14px;
  display: flex;
  flex-grow: 1;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  line-height: 1.5;
  .searchIcon {
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-right: 5px;
    background-image: url('@/assets/images_sizhuo/sprite.png');
    vertical-align: middle;
    background-size: 89.25px 78.75px;
    background-position: -52.5px -19.875px;
    color: #333;
    text-size-adjust: 100%;
  }
  .keyword {
    color: #666;
    text-size-adjust: 100%;
  }
}
</style>
